﻿@{
    ViewBag.Title = "Details"; 
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    layui.use(['jquery', 'form', 'table', 'commonTable', 'common', 'optimizeSelectOption'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table, commonTable = layui.commonTable,
            common = layui.common;
        var keyValue = $.request("keyValue");
        $("#F_MaterialType").bindSelect({
            data: top.clients.dataItems['Mes_MaterialType'],
            id: "",
        });
        //权限字段
        common.authorizeFields('adminform');
        commonTable.rendertable({
            elem: '#currentTableId',
            id: 'currentTableId',
            search: false,
            limit: 9999,//每页数据 默认
            page: { //支持传入 laypage 组件的所有参数（某些参数除外，如：jump/elem） - 详见文档
                layout: ['count'] //自定义分页布局
                , first: false //不显示首页
                , last: false //不显示尾页
            },
            defaultToolbar: [],
            toolbar: '',//工具栏
            data: [],
            height: 'full-260',
            cols: [[
                { field: 'F_TransferBoxCode', title: '流转箱编号', width: 170, sort: true, filter: true },
                { field: 'F_LocationCode', title: '库位编号', width: 180, sort: true, filter: true },
                {
                    field: 'F_MaterialType', title: '料号分类', width: 110, sort: true, filter: true,
                    templet: function (d) {
                        return top.clients.dataItems["Mes_MaterialType"][d.F_MaterialType] == null ? "" : top.clients.dataItems["Mes_MaterialType"][d.F_MaterialType];
                    }
                },
                { field: 'F_MaterialCode', title: '料号编号', width: 170, sort: true, filter: true },
                { field: 'F_MaterialName', title: '料号名称', width: 200, sort: true, filter: true },
                { field: 'F_MaterialUnit', title: '料号单位', width: 110, sort: true, filter: true },
                { field: 'F_MaterialBatch', title: '批号', width: 180, sort: true, filter: true },
                { field: 'F_Num', title: '数量', width: 80, sort: true, filter: true },
                { field: 'F_BandingUserName', title: '绑定人', width: 95, sort: true, filter: true },
                {
                    field: 'F_BandingTime', title: '绑定时间', width: 160, sort: true, filter: { type: 'date[yyyy/MM/dd HH:mm:ss]' }
                },
                { field: 'F_CreatorUserName', title: '上架人', width: 95, sort: true, filter: true },
                {
                    field: 'F_CreatorTime', title: '上架时间', width: 160, sort: true, filter: { type: 'date[yyyy/MM/dd HH:mm:ss]' }
                },
                { field: 'F_Description', title: '备注', minWidth: 100, sort: true, filter: true }
            ]]
        });
        $(function () {
            common.ajax({
                url: '/MaterialManage/InStorage/GetFormJson',
                dataType: 'json',
                data: { keyValue: keyValue },
                async: false,
                success: function (data) {
                    common.val('adminform', data);
                    common.setReadOnly('adminform');
                    if (!!data.list && data.list.length > 0) {
                        table.reload('currentTableId', {
                            data: data.list
                        });
                    }
                    form.render();
                }
            });
        });

        wcLoading.close();
    });
</script>
<div class="layuimini-container" lay-filter="adminform">
    <div class="layuimini-main">
        <form class="layui-form layuimini-form">
            <div class="layui-form-item">
                <div class="layui-col-md6 layui-col-sm6 layui-hide">
                    <label class="layui-form-label">入库单编号</label>
                    <div class="layui-input-block">
                        <input type="text" id="F_InStorageCode" name="F_InStorageCode" class="layui-input">
                    </div>
                </div>
                <div class="layui-col-md6 layui-col-sm6 layui-hide">
                    <label class="layui-form-label">物料分类</label>
                    <div class="layui-input-block">
                        <select id="F_MaterialType" name="F_MaterialType" lay-search>
                            <option value="" selected>请选择</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-md6 layui-col-sm6 layui-hide">
                    <label class="layui-form-label">物料编号</label>
                    <div class="layui-input-block">
                        <input id="F_MaterialCode" name="F_MaterialCode" type="text" class="layui-input" />
                    </div>
                </div>
                <div class="layui-col-md6 layui-col-sm6 layui-hide">
                    <label class="layui-form-label">物料名称</label>
                    <div class="layui-input-block">
                        <input id="F_MaterialName" name="F_MaterialName" type="text" class="layui-input" />
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-md6 layui-col-sm6 layui-hide">
                    <label class="layui-form-label">计划数量</label>
                    <div class="layui-input-block">
                        <input type="number" pattern="[0-9]*" id="F_Num" name="F_Num" class="layui-input">
                    </div>
                </div>
                <div class="layui-col-md6 layui-col-sm6 layui-hide">
                    <label class="layui-form-label">绑托数量</label>
                    <div class="layui-input-block">
                        <input type="number" pattern="[0-9]*" id="F_DoneNum" name="F_DoneNum" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-md6 layui-col-sm6 layui-hide">
                    <label class="layui-form-label">上架数量</label>
                    <div class="layui-input-block">
                        <input type="number" pattern="[0-9]*" id="F_StorageNum" name="F_StorageNum" class="layui-input">
                    </div>
                </div>
                <div class="layui-col-md6 layui-col-sm6 layui-hide">
                    <label class="layui-form-label">不良数量</label>
                    <div class="layui-input-block">
                        <input type="number" pattern="[0-9]*" id="F_BadNum" name="F_BadNum" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-md12 layui-col-sm12 layui-hide">
                    <label class="layui-form-label">备注</label>
                    <div class="layui-input-block">
                        <input id="text" name="F_Description" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-md6 layui-col-sm6 layui-hide">
                    <label class="layui-form-label">计划时间</label>
                    <div class="layui-input-block">
                        <input id="F_PlanTime" name="F_PlanTime" type="text" class="layui-input" />
                    </div>
                </div>
                <div class="layui-col-md6 layui-col-sm6 layui-hide">
                    <label class="layui-form-label">车辆</label>
                    <div class="layui-input-block">
                        <input id="F_CarNo" name="F_CarNo" type="text" class="layui-input" />
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-md12">
                    <label class="layui-form-label">记录列表</label>
                    <div class="layui-input-block">
                        <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

